[id].vue 716 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <LayoutContainer>
  3. <h2>{{ $t('cycle') }}</h2>
  4. <UiFormEdition
  5. :model="Cycle"
  6. :go-back-route="goBackRoute"
  7. >
  8. <template v-slot="{ entity }">
  9. <UiInputText
  10. field="label"
  11. v-model="entity.label"
  12. :rules="rules()"
  13. />
  14. </template>
  15. </UiFormEdition>
  16. </LayoutContainer>
  17. </template>
  18. <script setup lang="ts">
  19. import { useI18n } from 'vue-i18n'
  20. import Cycle from "~/models/Education/Cycle";
  21. const i18n = useI18n()
  22. const goBackRoute = { path: `/parameters`, query: { tab: 'teaching' } }
  23. const rules = () => [
  24. (label: string | null) => (label !== null && label.length > 0) || i18n.t('please_enter_a_value'),
  25. ]
  26. </script>